import java.util.Random;

public enum ArrayGenerator {
    INSTANCE;

    /**
     * 生成一个长度为 n 的随机数组，每个数字的范围是 [0,bound)
     *
     * @param n
     * @param bound
     * @return
     */
    public Integer[] generatorRandomArray(Integer n, Integer bound) {
        Integer[] arr = new Integer[n];
        Random rnd = new Random();
        for (int i = 0; i < arr.length; i++)
            arr[i] = rnd.nextInt(bound);
        return arr;
    }

    public Integer[] generatorOrderedArray(Integer n) {
        Integer[] arr = new Integer[n];
        for (int i = 0; i < arr.length; i++)
            arr[i] = i;
        return arr;
    }
}
